// import { folderAdd_status } from "./buttonStatus";
/**
 * 按钮权限
 */
interface IButtonGroup {
  title: string;
  icon: string;
  list: IButtonList[];
}
interface IButtonList {
  title: string;
  icon: string;
  disabled: boolean;
  show: boolean;
  alias: string;
}
// 父级按钮集合
export const buttonList: (IButtonList | IButtonGroup)[] = [
  {
    title: "常用操作",
    icon: "Operation",
    list: [
      { title: "批量挂接全文", icon: "Link", disabled: true, show: true, alias: "批量挂接全文" },
      { title: "轨迹查看", icon: "MapLocation", disabled: true, show: true, alias: "轨迹查看" },
      { title: "OCR", icon: "Ticket", disabled: true, show: true, alias: "OCR" },
      { title: "权限管理", icon: "Management", disabled: true, show: true, alias: "权限管理" },
      { title: "离线挂接", icon: "Download", disabled: true, show: true, alias: "离线挂接" },
      { title: "标记备注", icon: "Flag", disabled: true, show: true, alias: "标记备注" },
      { title: "数据查重", icon: "Checked", disabled: true, show: true, alias: "数据查重" },
      { title: "查找替换", icon: "SwitchFilled", disabled: true, show: true, alias: "查找替换" },
      { title: "文件锁定", icon: "Lock", disabled: true, show: true, alias: "文件锁定" },
      { title: "文件解锁", icon: "Unlock", disabled: true, show: true, alias: "文件解锁" },
      { title: "合卷", icon: "Unlock", disabled: true, show: true, alias: "合卷" },
      { title: "拆卷", icon: "Unlock", disabled: true, show: true, alias: "拆卷" },
      { title: "查询归卷", icon: "Unlock", disabled: true, show: true, alias: "查询归卷" }
    ]
  },
  {
    title: "导入/导出",
    icon: "Upload",
    list: [
      { title: "前端导出", icon: "Upload", disabled: true, show: true, alias: "前端导出" },
      { title: "导出归档登记表", icon: "Upload", disabled: true, show: true, alias: "导出归档登记表" },
      { title: "导出归档目录清单", icon: "Upload", disabled: true, show: true, alias: "导出归档目录清单" },
      { title: "Excel导入", icon: "BottomLeft", disabled: true, show: true, alias: "Excel导入" },
      { title: "打包", icon: "Download", disabled: true, show: true, alias: "打包" },
      { title: "打包下载全文", icon: "Download", disabled: true, show: true, alias: "打包下载全文" }
    ]
  },
  {
    title: "二维码",
    icon: "QrcodeOutlined",
    list: [
      { title: "目录二维码", icon: "QrcodeOutlined", disabled: true, show: true, alias: "目录二维码" },
      { title: "数据二维码", icon: "QrcodeOutlined", disabled: true, show: true, alias: "数据二维码" }
    ]
  },
  { title: "新增", icon: "FolderAdd", disabled: true, show: true, alias: "新增" },
  { title: "修改", icon: "Edit", disabled: true, show: true, alias: "修改" },
  { title: "删除", icon: "Delete", disabled: true, show: true, alias: "删除" },
  { title: "克隆", icon: "DocumentCopy", disabled: true, show: true, alias: "克隆" },
  { title: "复制", icon: "CopyDocument", disabled: true, show: true, alias: "复制" },
  { title: "粘贴", icon: "Document", disabled: true, show: true, alias: "粘贴" },
  { title: "剪贴", icon: "DocumentChecked", disabled: true, show: true, alias: "剪贴" },
  { title: "修改分类", icon: "Tickets", disabled: true, show: true, alias: "修改分类" },
  { title: "流水操作", icon: "Sort", disabled: true, show: false, alias: "流水操作" },
  { title: "小流水操作", icon: "Sort", disabled: true, show: false, alias: "小流水操作" },
  // {
  //   title: "流水",
  //   icon: "Sort",
  //   list: [
  //     // { title: "重置大流水", icon: "Sort", disabled: true, show: false, alias: "重置大流水" },
  //     // { title: "大流水上移", icon: "Sort", disabled: true, show: false, alias: "大流水上移" },
  //     // { title: "大流水下移", icon: "Sort", disabled: true, show: false, alias: "大流水下移" },
  //     // { title: "大流水移至", icon: "Sort", disabled: true, show: false, alias: "大流水移至" },
  //     // { title: "重置小流水", icon: "Sort", disabled: true, show: false, alias: "重置小流水" },
  //     // { title: "小流水上移", icon: "Sort", disabled: true, show: false, alias: "小流水上移" },
  //     // { title: "小流水下移", icon: "Sort", disabled: true, show: false, alias: "小流水下移" },
  //     // { title: "小流水移至", icon: "Sort", disabled: true, show: false, alias: "小流水移至" }
  //     { title: "流水号操作", icon: "Sort", disabled: true, show: false, alias: "小流水移至" }
  //   ]
  // },
  {
    title: "流程",
    icon: "Sort",
    list: [
      { title: "数据提交", icon: "Sort", disabled: true, show: false, alias: "数据提交" },
      { title: "数据撤回", icon: "Sort", disabled: true, show: false, alias: "数据撤回" },
      { title: "数据接收", icon: "Sort", disabled: true, show: false, alias: "数据接收" },
      { title: "撤销接收", icon: "Sort", disabled: true, show: false, alias: "撤销接收" },
      { title: "数据退回", icon: "Sort", disabled: true, show: false, alias: "数据退回" },
      { title: "移交入库", icon: "Sort", disabled: true, show: false, alias: "移交入库" },
      { title: "撤销入库", icon: "Sort", disabled: true, show: false, alias: "撤销入库" },
      { title: "入库确认", icon: "Sort", disabled: true, show: false, alias: "入库确认" },
      { title: "退回整编", icon: "Sort", disabled: true, show: false, alias: "退回整编" },
      { title: "数据开放", icon: "Sort", disabled: true, show: false, alias: "数据开放" },
      { title: "取消开放", icon: "Sort", disabled: true, show: false, alias: "取消开放" }
    ]
  }
];
// 全文按钮集合
export const fulltextButton: IButtonList[] = [
  { title: "挂接全文", icon: "Upload", disabled: true, show: true, alias: "挂接全文" },
  { title: "下载全文", icon: "Download", disabled: true, show: true, alias: "下载全文" },
  { title: "删除全文", icon: "Delete", disabled: true, show: true, alias: "删除全文" },
  { title: "全文OCR", icon: "Ticket", disabled: true, show: true, alias: "全文OCR" },
  { title: "权限管理", icon: "Management", disabled: true, show: true, alias: "权限管理" }
];

// 子级表格按钮集合
export const childButtonList: (IButtonList | IButtonGroup)[] = [
  {
    title: "常用操作",
    icon: "Operation",
    list: [
      { title: "移交下一环节", icon: "SortDown", disabled: true, show: true, alias: "移交下一环节" },
      { title: "退回上一步", icon: "SortUp", disabled: true, show: true, alias: "退回上一步" },
      { title: "批量挂接全文", icon: "Link", disabled: true, show: true, alias: "批量挂接全文" },
      { title: "轨迹查看", icon: "MapLocation", disabled: true, show: true, alias: "轨迹查看" },
      { title: "OCR", icon: "Ticket", disabled: true, show: true, alias: "OCR" },
      { title: "权限管理", icon: "Management", disabled: true, show: true, alias: "权限管理" },
      { title: "离线挂接", icon: "Download", disabled: true, show: true, alias: "离线挂接" },
      { title: "标记备注", icon: "Flag", disabled: true, show: true, alias: "标记备注" },
      { title: "数据查重", icon: "Checked", disabled: true, show: true, alias: "数据查重" },
      { title: "查找替换", icon: "SwitchFilled", disabled: true, show: true, alias: "查找替换" },
      { title: "文件锁定", icon: "Lock", disabled: true, show: true, alias: "文件锁定" },
      { title: "文件解锁", icon: "Unlock", disabled: true, show: true, alias: "文件解锁" },
      { title: "合卷", icon: "Unlock", disabled: true, show: true, alias: "合卷" },
      { title: "拆卷", icon: "Unlock", disabled: true, show: true, alias: "拆卷" },
      { title: "查询归卷", icon: "Unlock", disabled: true, show: true, alias: "查询归卷" }
    ]
  },
  {
    title: "导入/导出",
    icon: "Upload",
    list: [
      { title: "前端导出", icon: "Upload", disabled: true, show: true, alias: "前端导出" },
      { title: "导出归档登记表", icon: "Upload", disabled: true, show: true, alias: "导出归档登记表" },
      { title: "导出归档目录清单", icon: "Upload", disabled: true, show: true, alias: "导出归档目录清单" },
      { title: "Excel导入", icon: "BottomLeft", disabled: true, show: true, alias: "Excel导入" },
      { title: "打包", icon: "Download", disabled: true, show: true, alias: "打包" },
      { title: "打包下载全文", icon: "Download", disabled: true, show: true, alias: "打包下载全文" }
    ]
  },
  {
    title: "二维码",
    icon: "QrcodeOutlined",
    list: [
      { title: "目录二维码", icon: "QrcodeOutlined", disabled: true, show: true, alias: "目录二维码" },
      { title: "数据二维码", icon: "QrcodeOutlined", disabled: true, show: true, alias: "数据二维码" }
    ]
  },
  { title: "新增", icon: "FolderAdd", disabled: true, show: true, alias: "新增" },
  { title: "修改", icon: "Edit", disabled: true, show: true, alias: "修改" },
  { title: "删除", icon: "Delete", disabled: true, show: true, alias: "删除" },
  { title: "克隆", icon: "DocumentCopy", disabled: true, show: true, alias: "克隆" },
  { title: "复制", icon: "CopyDocument", disabled: true, show: true, alias: "复制" },
  { title: "粘贴", icon: "Document", disabled: true, show: true, alias: "粘贴" },
  { title: "剪贴", icon: "DocumentChecked", disabled: true, show: true, alias: "剪贴" },
  { title: "修改分类", icon: "Tickets", disabled: true, show: true, alias: "修改分类" },
  { title: "流水操作", icon: "Sort", disabled: true, show: false, alias: "流水操作" },
  { title: "小流水操作", icon: "Sort", disabled: true, show: false, alias: "小流水操作" },
  // {
  //   title: "流水",
  //   icon: "Sort",
  //   list: [
  //     { title: "重置大流水", icon: "Sort", disabled: true, show: false, alias: "重置大流水" },
  //     { title: "大流水上移", icon: "Sort", disabled: true, show: false, alias: "大流水上移" },
  //     { title: "大流水下移", icon: "Sort", disabled: true, show: false, alias: "大流水下移" },
  //     { title: "大流水移至", icon: "Sort", disabled: true, show: false, alias: "大流水移至" },
  //     { title: "重置小流水", icon: "Sort", disabled: true, show: false, alias: "重置小流水" },
  //     { title: "小流水上移", icon: "Sort", disabled: true, show: false, alias: "小流水上移" },
  //     { title: "小流水下移", icon: "Sort", disabled: true, show: false, alias: "小流水下移" },
  //     { title: "小流水移至", icon: "Sort", disabled: true, show: false, alias: "小流水移至" }
  //   ]
  // },
  {
    title: "流程",
    icon: "Sort",
    list: [
      { title: "数据提交", icon: "Sort", disabled: true, show: false, alias: "数据提交" },
      { title: "数据撤回", icon: "Sort", disabled: true, show: false, alias: "数据撤回" },
      { title: "数据接收", icon: "Sort", disabled: true, show: false, alias: "数据接收" },
      { title: "数据退回", icon: "Sort", disabled: true, show: false, alias: "数据退回" },
      { title: "撤销接收", icon: "Sort", disabled: true, show: false, alias: "撤销接收" },
      { title: "移交入库", icon: "Sort", disabled: true, show: false, alias: "移交入库" },
      { title: "入库确认", icon: "Sort", disabled: true, show: false, alias: "入库确认" },
      { title: "撤销入库", icon: "Sort", disabled: true, show: false, alias: "撤销入库" },
      { title: "入库退回", icon: "Sort", disabled: true, show: false, alias: "入库退回" },
      { title: "数据开放", icon: "Sort", disabled: true, show: false, alias: "数据开放" },
      { title: "取消开放", icon: "Sort", disabled: true, show: false, alias: "取消开放" }
    ]
  }
];
/*
 * 用于权限处理,获取数组list
 *
 */
export const getButtonList = () => {
  const arr: any[] = [];
  buttonList.forEach(item => {
    if (item.list) {
      item.list.forEach(item2 => {
        arr.push(item2.title);
      });
    } else {
      arr.push(item.title);
    }
  });
  return [...new Set(arr)];
};
export const getFulltextList = () => {
  const arr: any[] = [];
  fulltextButton.forEach(item => {
    arr.push(item.title);
  });
  return [...new Set(arr)];
};
export const getChildButtonList = () => {
  const arr: any[] = [];
  // childButtonList.forEach(item => {
  //   arr.push(item.title);
  // });
  childButtonList.forEach(item => {
    if (item.list) {
      item.list.forEach(item2 => {
        arr.push(item2.title);
      });
    } else {
      arr.push(item.title);
    }
  });
  return [...new Set(arr)];
};
